package com.neusoft.html.parser.helper; class DataUtil { void a() { int a;
a=0;// .class public Lcom/neusoft/html/parser/helper/DataUtil;
a=0;// .super Ljava/lang/Object;
a=0;// .source "DataUtil.java"
a=0;// 
a=0;// 
a=0;// # static fields
a=0;// .field private static final bufferSize:I = 0x20000
a=0;// 
a=0;// .field private static final charsetPattern:Ljava/util/regex/Pattern;
a=0;// 
a=0;// .field static final defaultCharset:Ljava/lang/String; = "UTF-8"
a=0;// 
a=0;// 
a=0;// # direct methods
a=0;// .method static constructor <clinit>()V
a=0;//     .locals 1
a=0;// 
a=0;//     .prologue
a=0;//     .line 24
a=0;//     const-string v0, "(?i)\\bcharset=\\s*\"?([^\\s;\"]*)"
a=0;// 
a=0;//     #v0=(Reference,Ljava/lang/String;);
a=0;//     invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     sput-object v0, Lcom/neusoft/html/parser/helper/DataUtil;->charsetPattern:Ljava/util/regex/Pattern;
a=0;// 
a=0;//     .line 26
a=0;//     return-void
a=0;// .end method
a=0;// 
a=0;// .method private constructor <init>()V
a=0;//     .locals 0
a=0;// 
a=0;//     .prologue
a=0;//     .line 28
a=0;//     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
a=0;// 
a=0;//     #p0=(Reference,Lcom/neusoft/html/parser/helper/DataUtil;);
a=0;//     return-void
a=0;// .end method
a=0;// 
a=0;// .method static getCharsetFromContentType(Ljava/lang/String;)Ljava/lang/String;
a=0;//     .locals 3
a=0;// 
a=0;//     .prologue
a=0;//     const/4 v0, 0x0
a=0;// 
a=0;//     .line 132
a=0;//     #v0=(Null);
a=0;//     if-nez p0, :cond_1
a=0;// 
a=0;//     .line 140
a=0;//     :cond_0
a=0;//     :goto_0
a=0;//     #v0=(Reference,Ljava/lang/String;);v1=(Conflicted);v2=(Conflicted);
a=0;//     return-object v0
a=0;// 
a=0;//     .line 133
a=0;//     :cond_1
a=0;//     #v0=(Null);v1=(Uninit);v2=(Uninit);
a=0;//     sget-object v1, Lcom/neusoft/html/parser/helper/DataUtil;->charsetPattern:Ljava/util/regex/Pattern;
a=0;// 
a=0;//     #v1=(Reference,Ljava/util/regex/Pattern;);
a=0;//     invoke-virtual {v1, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
a=0;// 
a=0;//     move-result-object v1
a=0;// 
a=0;//     .line 134
a=0;//     invoke-virtual {v1}, Ljava/util/regex/Matcher;->find()Z
a=0;// 
a=0;//     move-result v2
a=0;// 
a=0;//     #v2=(Boolean);
a=0;//     if-eqz v2, :cond_0
a=0;// 
a=0;//     .line 135
a=0;//     const/4 v2, 0x1
a=0;// 
a=0;//     #v2=(One);
a=0;//     invoke-virtual {v1, v2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v1
a=0;// 
a=0;//     invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v1
a=0;// 
a=0;//     .line 136
a=0;//     invoke-static {v1}, Ljava/nio/charset/Charset;->isSupported(Ljava/lang/String;)Z
a=0;// 
a=0;//     move-result v2
a=0;// 
a=0;//     #v2=(Boolean);
a=0;//     if-eqz v2, :cond_2
a=0;// 
a=0;//     move-object v0, v1
a=0;// 
a=0;//     #v0=(Reference,Ljava/lang/String;);
a=0;//     goto :goto_0
a=0;// 
a=0;//     .line 137
a=0;//     :cond_2
a=0;//     #v0=(Null);
a=0;//     sget-object v2, Ljava/util/Locale;->ENGLISH:Ljava/util/Locale;
a=0;// 
a=0;//     #v2=(Reference,Ljava/util/Locale;);
a=0;//     invoke-virtual {v1, v2}, Ljava/lang/String;->toUpperCase(Ljava/util/Locale;)Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v1
a=0;// 
a=0;//     .line 138
a=0;//     invoke-static {v1}, Ljava/nio/charset/Charset;->isSupported(Ljava/lang/String;)Z
a=0;// 
a=0;//     move-result v2
a=0;// 
a=0;//     #v2=(Boolean);
a=0;//     if-eqz v2, :cond_0
a=0;// 
a=0;//     move-object v0, v1
a=0;// 
a=0;//     #v0=(Reference,Ljava/lang/String;);
a=0;//     goto :goto_0
a=0;// .end method
a=0;// 
a=0;// .method public static load(Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)Lcom/neusoft/html/parser/nodes/Document;
a=0;//     .locals 3
a=0;// 
a=0;//     .prologue
a=0;//     .line 39
a=0;//     const/4 v2, 0x0
a=0;// 
a=0;//     .line 41
a=0;//     :try_start_0
a=0;//     #v2=(Null);
a=0;//     new-instance v1, Ljava/io/FileInputStream;
a=0;// 
a=0;//     #v1=(UninitRef,Ljava/io/FileInputStream;);
a=0;//     invoke-direct {v1, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
a=0;//     :try_end_0
a=0;//     .catchall {:try_start_0 .. :try_end_0} :catchall_0
a=0;// 
a=0;//     .line 42
a=0;//     :try_start_1
a=0;//     #v1=(Reference,Ljava/io/FileInputStream;);
a=0;//     invoke-static {v1}, Lcom/neusoft/html/parser/helper/DataUtil;->readToByteBuffer(Ljava/io/InputStream;)Ljava/nio/ByteBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 43
a=0;//     #v0=(Reference,Ljava/nio/ByteBuffer;);
a=0;//     invoke-static {}, Lcom/neusoft/html/parser/tree/Parser;->htmlParser()Lcom/neusoft/html/parser/tree/Parser;
a=0;// 
a=0;//     move-result-object v2
a=0;// 
a=0;//     #v2=(Reference,Lcom/neusoft/html/parser/tree/Parser;);
a=0;//     invoke-static {v0, p1, p2, v2}, Lcom/neusoft/html/parser/helper/DataUtil;->parseByteData(Ljava/nio/ByteBuffer;Ljava/lang/String;Ljava/lang/String;Lcom/neusoft/html/parser/tree/Parser;)Lcom/neusoft/html/parser/nodes/Document;
a=0;//     :try_end_1
a=0;//     .catchall {:try_start_1 .. :try_end_1} :catchall_1
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 45
a=0;//     invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
a=0;// 
a=0;//     .line 43
a=0;//     return-object v0
a=0;// 
a=0;//     .line 44
a=0;//     :catchall_0
a=0;//     #v0=(Uninit);v1=(Conflicted);v2=(Null);
a=0;//     move-exception v0
a=0;// 
a=0;//     #v0=(Reference,Ljava/lang/Throwable;);
a=0;//     move-object v1, v2
a=0;// 
a=0;//     .line 45
a=0;//     :goto_0
a=0;//     #v1=(Reference,Ljava/io/FileInputStream;);v2=(Reference,Lcom/neusoft/html/parser/tree/Parser;);
a=0;//     if-eqz v1, :cond_0
a=0;// 
a=0;//     .line 46
a=0;//     invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
a=0;// 
a=0;//     .line 47
a=0;//     :cond_0
a=0;//     throw v0
a=0;// 
a=0;//     .line 44
a=0;//     :catchall_1
a=0;//     #v0=(Conflicted);
a=0;//     move-exception v0
a=0;// 
a=0;//     #v0=(Reference,Ljava/lang/Throwable;);
a=0;//     goto :goto_0
a=0;// .end method
a=0;// 
a=0;// .method public static load(Ljava/io/InputStream;Ljava/lang/String;Ljava/lang/String;)Lcom/neusoft/html/parser/nodes/Document;
a=0;//     .locals 2
a=0;// 
a=0;//     .prologue
a=0;//     .line 59
a=0;//     invoke-static {p0}, Lcom/neusoft/html/parser/helper/DataUtil;->readToByteBuffer(Ljava/io/InputStream;)Ljava/nio/ByteBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 60
a=0;//     #v0=(Reference,Ljava/nio/ByteBuffer;);
a=0;//     invoke-static {}, Lcom/neusoft/html/parser/tree/Parser;->htmlParser()Lcom/neusoft/html/parser/tree/Parser;
a=0;// 
a=0;//     move-result-object v1
a=0;// 
a=0;//     #v1=(Reference,Lcom/neusoft/html/parser/tree/Parser;);
a=0;//     invoke-static {v0, p1, p2, v1}, Lcom/neusoft/html/parser/helper/DataUtil;->parseByteData(Ljava/nio/ByteBuffer;Ljava/lang/String;Ljava/lang/String;Lcom/neusoft/html/parser/tree/Parser;)Lcom/neusoft/html/parser/nodes/Document;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     return-object v0
a=0;// .end method
a=0;// 
a=0;// .method public static load(Ljava/io/InputStream;Ljava/lang/String;Ljava/lang/String;Lcom/neusoft/html/parser/tree/Parser;)Lcom/neusoft/html/parser/nodes/Document;
a=0;//     .locals 1
a=0;// 
a=0;//     .prologue
a=0;//     .line 73
a=0;//     invoke-static {p0}, Lcom/neusoft/html/parser/helper/DataUtil;->readToByteBuffer(Ljava/io/InputStream;)Ljava/nio/ByteBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 74
a=0;//     #v0=(Reference,Ljava/nio/ByteBuffer;);
a=0;//     invoke-static {v0, p1, p2, p3}, Lcom/neusoft/html/parser/helper/DataUtil;->parseByteData(Ljava/nio/ByteBuffer;Ljava/lang/String;Ljava/lang/String;Lcom/neusoft/html/parser/tree/Parser;)Lcom/neusoft/html/parser/nodes/Document;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     return-object v0
a=0;// .end method
a=0;// 
a=0;// .method static parseByteData(Ljava/nio/ByteBuffer;Ljava/lang/String;Ljava/lang/String;Lcom/neusoft/html/parser/tree/Parser;)Lcom/neusoft/html/parser/nodes/Document;
a=0;//     .locals 5
a=0;// 
a=0;//     .prologue
a=0;//     const/4 v1, 0x0
a=0;// 
a=0;//     .line 81
a=0;//     .line 82
a=0;//     #v1=(Null);
a=0;//     if-nez p1, :cond_2
a=0;// 
a=0;//     .line 84
a=0;//     const-string v0, "UTF-8"
a=0;// 
a=0;//     #v0=(Reference,Ljava/lang/String;);
a=0;//     invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     invoke-virtual {v0, p0}, Ljava/nio/charset/Charset;->decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     invoke-virtual {v0}, Ljava/nio/CharBuffer;->toString()Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v2
a=0;// 
a=0;//     .line 85
a=0;//     #v2=(Reference,Ljava/lang/String;);
a=0;//     invoke-virtual {p3, v2, p2}, Lcom/neusoft/html/parser/tree/Parser;->parseInput(Ljava/lang/String;Ljava/lang/String;)Lcom/neusoft/html/parser/nodes/Document;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 86
a=0;//     const-string v3, "meta[http-equiv=content-type], meta[charset]"
a=0;// 
a=0;//     #v3=(Reference,Ljava/lang/String;);
a=0;//     invoke-virtual {v0, v3}, Lcom/neusoft/html/parser/nodes/Document;->select(Ljava/lang/String;)Lcom/neusoft/html/parser/select/Elements;
a=0;// 
a=0;//     move-result-object v3
a=0;// 
a=0;//     invoke-virtual {v3}, Lcom/neusoft/html/parser/select/Elements;->first()Lcom/neusoft/html/parser/nodes/Element;
a=0;// 
a=0;//     move-result-object v3
a=0;// 
a=0;//     .line 87
a=0;//     if-eqz v3, :cond_4
a=0;// 
a=0;//     .line 88
a=0;//     const-string v4, "http-equiv"
a=0;// 
a=0;//     #v4=(Reference,Ljava/lang/String;);
a=0;//     invoke-virtual {v3, v4}, Lcom/neusoft/html/parser/nodes/Element;->hasAttr(Ljava/lang/String;)Z
a=0;// 
a=0;//     move-result v4
a=0;// 
a=0;//     #v4=(Boolean);
a=0;//     if-eqz v4, :cond_1
a=0;// 
a=0;//     const-string v4, "content"
a=0;// 
a=0;//     #v4=(Reference,Ljava/lang/String;);
a=0;//     invoke-virtual {v3, v4}, Lcom/neusoft/html/parser/nodes/Element;->attr(Ljava/lang/String;)Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v3
a=0;// 
a=0;//     invoke-static {v3}, Lcom/neusoft/html/parser/helper/DataUtil;->getCharsetFromContentType(Ljava/lang/String;)Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v3
a=0;// 
a=0;//     .line 89
a=0;//     :goto_0
a=0;//     if-eqz v3, :cond_4
a=0;// 
a=0;//     invoke-virtual {v3}, Ljava/lang/String;->length()I
a=0;// 
a=0;//     move-result v4
a=0;// 
a=0;//     #v4=(Integer);
a=0;//     if-eqz v4, :cond_4
a=0;// 
a=0;//     const-string v4, "UTF-8"
a=0;// 
a=0;//     #v4=(Reference,Ljava/lang/String;);
a=0;//     invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
a=0;// 
a=0;//     move-result v4
a=0;// 
a=0;//     #v4=(Boolean);
a=0;//     if-nez v4, :cond_4
a=0;// 
a=0;//     .line 91
a=0;//     invoke-virtual {p0}, Ljava/nio/ByteBuffer;->rewind()Ljava/nio/Buffer;
a=0;// 
a=0;//     .line 92
a=0;//     invoke-static {v3}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     invoke-virtual {v0, p0}, Ljava/nio/charset/Charset;->decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     invoke-virtual {v0}, Ljava/nio/CharBuffer;->toString()Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     move-object p1, v3
a=0;// 
a=0;//     .line 99
a=0;//     :goto_1
a=0;//     #v1=(Reference,Lcom/neusoft/html/parser/nodes/Document;);v2=(Conflicted);v3=(Conflicted);v4=(Conflicted);
a=0;//     if-nez v1, :cond_3
a=0;// 
a=0;//     .line 103
a=0;//     invoke-virtual {v0}, Ljava/lang/String;->length()I
a=0;// 
a=0;//     move-result v1
a=0;// 
a=0;//     #v1=(Integer);
a=0;//     if-lez v1, :cond_0
a=0;// 
a=0;//     const/4 v1, 0x0
a=0;// 
a=0;//     #v1=(Null);
a=0;//     invoke-virtual {v0, v1}, Ljava/lang/String;->charAt(I)C
a=0;// 
a=0;//     move-result v1
a=0;// 
a=0;//     #v1=(Char);
a=0;//     const v2, 0xfeff
a=0;// 
a=0;//     #v2=(Char);
a=0;//     if-ne v1, v2, :cond_0
a=0;// 
a=0;//     .line 104
a=0;//     const/4 v1, 0x1
a=0;// 
a=0;//     #v1=(One);
a=0;//     invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 106
a=0;//     :cond_0
a=0;//     #v1=(Integer);v2=(Conflicted);
a=0;//     invoke-virtual {p3, v0, p2}, Lcom/neusoft/html/parser/tree/Parser;->parseInput(Ljava/lang/String;Ljava/lang/String;)Lcom/neusoft/html/parser/nodes/Document;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 107
a=0;//     invoke-virtual {v0}, Lcom/neusoft/html/parser/nodes/Document;->outputSettings()Lcom/neusoft/html/parser/nodes/Document$OutputSettings;
a=0;// 
a=0;//     move-result-object v1
a=0;// 
a=0;//     #v1=(Reference,Lcom/neusoft/html/parser/nodes/Document$OutputSettings;);
a=0;//     invoke-virtual {v1, p1}, Lcom/neusoft/html/parser/nodes/Document$OutputSettings;->charset(Ljava/lang/String;)Lcom/neusoft/html/parser/nodes/Document$OutputSettings;
a=0;// 
a=0;//     .line 109
a=0;//     :goto_2
a=0;//     return-object v0
a=0;// 
a=0;//     .line 88
a=0;//     :cond_1
a=0;//     #v1=(Null);v2=(Reference,Ljava/lang/String;);v3=(Reference,Lcom/neusoft/html/parser/nodes/Element;);v4=(Boolean);
a=0;//     const-string v4, "charset"
a=0;// 
a=0;//     #v4=(Reference,Ljava/lang/String;);
a=0;//     invoke-virtual {v3, v4}, Lcom/neusoft/html/parser/nodes/Element;->attr(Ljava/lang/String;)Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v3
a=0;// 
a=0;//     goto :goto_0
a=0;// 
a=0;//     .line 97
a=0;//     :cond_2
a=0;//     #v0=(Uninit);v2=(Uninit);v3=(Uninit);v4=(Uninit);
a=0;//     invoke-static {p1}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     #v0=(Reference,Ljava/nio/charset/Charset;);
a=0;//     invoke-virtual {v0, p0}, Ljava/nio/charset/Charset;->decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     invoke-virtual {v0}, Ljava/nio/CharBuffer;->toString()Ljava/lang/String;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     goto :goto_1
a=0;// 
a=0;//     :cond_3
a=0;//     #v1=(Reference,Lcom/neusoft/html/parser/nodes/Document;);v2=(Conflicted);v3=(Conflicted);v4=(Conflicted);
a=0;//     move-object v0, v1
a=0;// 
a=0;//     goto :goto_2
a=0;// 
a=0;//     :cond_4
a=0;//     #v1=(Null);v2=(Reference,Ljava/lang/String;);v3=(Reference,Ujava/lang/Object;);
a=0;//     move-object v1, v0
a=0;// 
a=0;//     #v1=(Reference,Lcom/neusoft/html/parser/nodes/Document;);
a=0;//     move-object v0, v2
a=0;// 
a=0;//     goto :goto_1
a=0;// .end method
a=0;// 
a=0;// .method static readToByteBuffer(Ljava/io/InputStream;)Ljava/nio/ByteBuffer;
a=0;//     .locals 4
a=0;// 
a=0;//     .prologue
a=0;//     const/high16 v2, 0x20000
a=0;// 
a=0;//     .line 113
a=0;//     #v2=(Integer);
a=0;//     new-array v0, v2, [B
a=0;// 
a=0;//     .line 114
a=0;//     #v0=(Reference,[B);
a=0;//     new-instance v1, Ljava/io/ByteArrayOutputStream;
a=0;// 
a=0;//     #v1=(UninitRef,Ljava/io/ByteArrayOutputStream;);
a=0;//     invoke-direct {v1, v2}, Ljava/io/ByteArrayOutputStream;-><init>(I)V
a=0;// 
a=0;//     .line 117
a=0;//     :goto_0
a=0;//     #v1=(Reference,Ljava/io/ByteArrayOutputStream;);v3=(Conflicted);
a=0;//     invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I
a=0;// 
a=0;//     move-result v2
a=0;// 
a=0;//     .line 118
a=0;//     const/4 v3, -0x1
a=0;// 
a=0;//     #v3=(Byte);
a=0;//     if-eq v2, v3, :cond_0
a=0;// 
a=0;//     .line 119
a=0;//     const/4 v3, 0x0
a=0;// 
a=0;//     #v3=(Null);
a=0;//     invoke-virtual {v1, v0, v3, v2}, Ljava/io/ByteArrayOutputStream;->write([BII)V
a=0;// 
a=0;//     goto :goto_0
a=0;// 
a=0;//     .line 121
a=0;//     :cond_0
a=0;//     #v3=(Byte);
a=0;//     invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     invoke-static {v0}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;
a=0;// 
a=0;//     move-result-object v0
a=0;// 
a=0;//     .line 122
a=0;//     return-object v0
a=0;// .end method
}}
